package main

import (
	"fmt"
	"github.com/jinzhu/gorm"
	"gogogo/basic/db/orm/model"
)
import _ "github.com/jinzhu/gorm/dialects/mysql"

func main() {
	db, err := gorm.Open("mysql", "root:root@tcp(172.20.0.10:3306)/gogogo?charset=utf8")
	if err != nil {
		panic("fail to connect db")
	}
	defer db.Close()
	//db.AutoMigrate(&model.MyStudent{})
	db.Create(&model.Student{Name: "白小小", StuNo: "20200030002"})
	fmt.Println(db)
}
